<template>
  <div>
    <transition name="fade">
      <div class="pageLoading" v-show="modelValue"><van-loading type="spinner" color="#fff" /></div>
    </transition>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
export default defineComponent({
  name: 'PageLoading',
  emits: ['onUpdate:modelValue'],
  props: {
    modelValue: {
      type: Boolean,
      require: true
    }
  },
  setup(prop) {
    return {}
  }
})
</script>

<style lang="scss" scope>
.pageLoading {
  position: absolute;
  z-index: 999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
}
</style>
